<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<style>
.col-xs-3 {
	padding: 1px;
	height: 1025px;
}

.col-xs-9 {
	height: 1025px;
}

.container {
	width: 1280px !important;
}

.xs11 {
	margin-top: 20px;
	margin-left: 30px;
}

#xs12 {
	height: 919px;
	width: 313px;
}

#xs11 {
	height: 140px;
}

#xs1 {
	height: 100px;
	width: 80px;
}

body {
	font-size: 12px;
}

ul {
	margin: 0;
	padding: 7px;
}

ul li {
	height: 22px;
	vertical-align: bottom;
}

.actived {
	height: 40px;
	border-top: 3px solid #ff9900;;
	border-right: 1px solid #AAC7E9;
	border-left: 1px solid #AAC7E9;
	border-bottom: 1px solid #AAC7E9;
	background: #FFDAB9;
}

.panel-group {
	padding: 1px;
	margin：1px;
}

td {
	text-align: center;
}

th {
	text-align: center;
}
</style>
<script type="text/javascript" language="javascript">
	POWTShow = undefined;
	POWTShowStuID=undefined;
	$(function() {
		POWTShow = $('#POWTSHOW')
				.datagrid(
						{
							url : '<%=request.getContextPath()%>/GetPOWT',
							pagination : true,
							fit : true,
							fitColumns : true,
							singleSelect : true,
							view : detailview,
							sortName : 'StudentId',
							sortOrder : 'asc',
							detailFormatter : function(index, row) {
								return '<div class="ddv">'+row.POWTStudentMsg+'</div>';
							},
							onExpandRow : function(index, row) {
								var ddv = $(this).datagrid('getRowDetail',
										index).find('div.ddv');
								ddv
										.panel({
											border : false,
											cache : true,
											onLoad : function() {
												$('#dg').datagrid(
														'fixDetailRowHeight',
														index);
												$('#dg').datagrid('selectRow',
														index);
												$('#dg').datagrid(
														'getRowDetail', index)
														.find('form').form(
																'load', row);
											}
										});
								$('#dg').datagrid('fixDetailRowHeight', index);
							},
							columns : [ [
									{
										field : 'StudentId',
										title : '学生学号',
										width : 100,
										sortable : true,
									},
									{
										field : 'StudentName',
										title : '学生姓名',
										width : 100,
									},
									{
										field : 'teacherName',
										title : '指导老师',
										width : 100,
									},
									{
										field : 'POWTStudentSubmitMsgTime',
										title : '周记提交时间',
										width : 100,
									},
									/*{
										field : 'POWTMsgState',
										title : '审核状态',
										width : 50,
										formatter : function(value, row, index) {
											if(value=="A"||value==null||value=="")
												return '待审核';
											else if(value=="B")
												return '未通过';
											else if(value=="C")
												return '通过';
										}
									},*/
									/*{
										field : 'btn',
										title : '操作',
										width : 100,
										formatter : function(value, row, index) {
											if(row.POWTMsgState==null||""==row.POWTMsgState||"A"==row.POWTMsgState)
											return '<button type="button" class="btn btn-success btn-xs" onclick="POWTPass('+row.id+')">通过</button>'
													+ '<a data-toggle="collapse" href="#collapseBTG"><button type="button" class="btn btn-danger btn-xs" onclick="POWTPassFail('+row.id+')">不通过</button>';
										else
											return '<button type="button" disabled="disabled" class="btn btn-error btn-xs">通过</button>'
													+ '<button type="button" disabled="disabled" class="btn btn-error btn-xs">不通过</button>';
										}
									}*/ ] ],
									onClickRow:function(rowIndex, rowData){
										document.getElementById("POWThidden").value=rowIndex;
									}
						});
						POWTPass=function(i)
						{
							$.post("<%=request.getContextPath()%>/POWTPass",{
							'id':i},function(r){
							document.location.reload();	
							//document.getElementById("TeacherShowInfo").val("");
							},'json');
						},
						POWTMsg=function()
						{
						$.ajax({
							url : '<%=request.getContextPath()%>/POWTMsg',
							data : {
								'id':POWTShowStuID,
								'msg':document.getElementById("POWTtextarea").value
							},
							dataType : 'json',
							success : function(r) {
								document.location.reload();	
							},
							error : function(r) {
								$.messager.alert('Warning', "请选择学生");
							}
						});
						},
						POWTPassFail=function(i)
						{
							POWTShowStuID=i;
							console.info("this is "+POWTShowStuID);
						}
	});
	function showWhat()
		{
			var collap=document.getElementById('collapseHelp');
			if(collap.style.display=='none')
				collap.style.display='block';
			else
				collap.style.display='none';
		}
</script>
						<div class="row">
							<div class="col-xs-12  xs11">
								<strong><font size="3">流程管理》审核进展记录</font> </strong>
							</div>
						</div>
						<div class="row">
							<div class="col-xs-11  xs11">
								<div class="panel panel-default">
									<div class="panel-heading" align="left">
										<a data-toggle="collapse" data-parent="#accordion"
											href="#collapseHelp" class="glyphicon glyphicon-chevron-down" onclick="showWhat()">
											操作指南 </a>
									</div>
									<div id="collapseHelp" class="panel-collapse collapse">
										<div class="panel-body">
											&nbsp;&nbsp;论文进展记录是学生每月需向老师提交两份论文进展记录：
											<ul>
												<li>学生开题报告经过审核通过后，才可以提交论文进展记录。</li>
												<li>教师需要浏览论文进展记录，并给出审核通过操作或审核不通过操作，不通过需要给出修改理由。</li>
												<li>如果学生的进展记录获得教师给出的不通过的评审，需要与指导教师沟通进行修改进展记录，直到通过为止。</li>
												<li>教师的评审论文进展记录的时间和记录，作文教师指导学生论文撰写的依据。</li>
											</ul>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="row">
							<div class="col-xs-11 xs11">
								<p>
									<b><font size="3">毕业设计流转状态：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;审核进展记录
									
								</p>
								</b></font>
							</div>
						</div>
						<br>
						<p align="center">
							<b><font size="3">学生周进展报告审核记录表 
						</p>
						</b>
						<div style="height:300px;">
							<table id="POWTSHOW"></table>
							
						</div>
						
						<div class="row">
            <div class="col-xs-11  xs11">
              <div class="panel panel-default">
                <div id="collapseBTG" class="panel-collapse collapse">
                  <div class="panel-body" align="center">
                    <textarea class="form-control" rows="3" placeholder="论文周进展情况反馈：" id="POWTtextarea"></textarea>
                    <br>
                    <button type="button" class="btn btn-success btn-bg" onclick="POWTMsg() " value="刷新"/>提交</button>
                    &nbsp;&nbsp;&nbsp;
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseBTG">
                      <button type="button" class="btn btn-danger btn-bg">返回</button>
                      </a></td>
                  </div>
                </div>
              </div>
            </div>
          </div>